﻿using System;
using YJKSparseDistance.ModelLayer;
using YJKInspectModelFunc.ModelLayer;

namespace YJKSparseDisOfDoor.ModelLayer
{
	public class RoomDoor
	{
		public RoomPacker_EvacuationDistance DoorInRoom { get; private set; }

		public BaseDoorPacker Door { get; private set; }

		public RoomDoor(RoomPacker_EvacuationDistance room, BaseDoorPacker door)
		{
			this.DoorInRoom = room;
			this.Door = door;
		}

		public override bool Equals(object obj)
		{
			RoomDoor roomDoor = obj as RoomDoor;
			return roomDoor != null && (roomDoor.Door.ThisElementPackerId == this.Door.ThisElementPackerId && roomDoor.DoorInRoom.ThisElementPackerId == this.DoorInRoom.ThisElementPackerId);
		}

		public override int GetHashCode()
		{
			return this.Door.GetHashCode();
		}
	}
}
